<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/includes/common.jsp" %>

<c:set var="dish" value="${action.dish}"></c:set>

<div class="view-action">
	<a href="list?edit=${param.edit}">Về danh sách</a>
	<c:if test="${param.edit!=false || empty param.edit}">
	<c:if test="${not empty dish}">
		.
		<a href="edit?id=${dish.id}">Sửa</a>
		.
	    <a href="delete?id=${dish.id}">Xoá</a>
	</c:if>
	</c:if>
</div>

<c:choose>
    <c:when test="${empty dish}">
        Không tìm thấy
    </c:when>
    <c:otherwise>
        <div class="dish-image">
            <c:choose>
                <c:when test="${empty dish.image}">
                    <img src="${path}/images/dishes/${dish.id}.jpg" />
                </c:when>
	            <c:otherwise>
	                <img src="${path}/images/dishes/${dish.image}" />
	            </c:otherwise>
            </c:choose>
        </div>
        <p>
		ID: <b>${dish.id}</b>
		</p>
        <p>
		Tên: <b>${dish.name}</b> 
        </p>
        <p>
        ${dish.description}
        </p>
    </c:otherwise>
</c:choose>